package com.juyu.miliao.api.dao.mysql;

import com.juyu.miliao.api.domain.UserAssessLabel;
import com.juyu.miliao.api.domain.UserLikeLabel;
import com.juyu.miliao.common.dataSource.tool.operate.Operate;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Auther: 卜加超
 * @Date: 2019/5/30 16:54
 * @Description:
 */
@Repository
public class UserAssessLabelDao {
    @Resource
    private SqlSession sqlSession;

    public void insertUserAssessLabel(UserAssessLabel userAssessLabel, Long userId) {
        sqlSession.insert("insertUserAssessLabel",userAssessLabel);
    }
    public List<UserAssessLabel> getUserAssessLabel(long userId,long insertUserId) {
        Map<String, Object> params = new HashMap<>();
        params.put("userId", userId);
        params.put("insertUserId", insertUserId);
        return sqlSession.selectList("getUserAssessLabel",params);
    }
    public void delUserAssessLabel(long userId, long insertUserId) {
        Map<String, Object> params = new HashMap<>();
        params.put("userId", userId);
        params.put("insertUserId", insertUserId);
         sqlSession.delete("delUserAssessLabel",params);
    }

    public List<UserAssessLabel> getUserAssessLabelToList(long userId) {
        return sqlSession.selectList("getUserAssessLabelToList",userId);
    }
}
